#pragma once
#include<string>
extern "C" {
#include "../ThirdParty/paho-c/Release/include/MQTTClient.h"
}

#include<iostream>
using namespace std;

#define QOS         1

class MqttMessageRecive
{
public:
	MqttMessageRecive();
	~MqttMessageRecive();

private:
	MQTTClient client;
	MQTTClient_deliveryToken token;
	volatile MQTTClient_deliveryToken deliveredtoken;
public:

	struct FMqttConnectParam
	{
		string clientID;
		string remoteIP;
		int keepAliveInterval;
		int cleansession;
	};
	



	static void delivered(void* context, MQTTClient_deliveryToken dt);
	static int msgarrvd(void* context, char* topicName, int topicLen, MQTTClient_message* message);
	static void connlost(void* context, char* cause);


	bool MqttConnect(FMqttConnectParam connectionParam);
	bool MQTT_Subscribe(string topic);





	//bool MQTT_Publish(string topic, string payload);



	
};



